
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 1678. -- [Usaco2005 Jan] Watchcow -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>1678: [Usaco2005 Jan] Watchcow</h2><span class=green>Time Limit: </span>5 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>64 MB<br><span class=green>Submit: </span>16&nbsp;&nbsp;<span class=green>Solved: </span>0<br>[<a href='submitpage.php?id=1678'>Submit</a>][<a href='problemstatus.php?id=1678'>Status</a>][<a href='bbs.php?id=1678'>Discuss</a>]</center><h2>Description</h2><div class=content>Bessie's been appointed the new watch-cow for the farm. Every night,
it's her job to walk across the farm and make sure that no evildoers
are doing any evil. She begins at the barn, makes her patrol, and
then returns to the barn when she's done.

If she were a more observant cow, she might be able to just walk
each of M (1 <= M <= 50,000) bidirectional trails numbered 1..M
between N (2 <= N <= 10,000) fields numbered 1..N on the farm once
and be confident that she's seen everything she needs to see.  But
since she isn't, she wants to make sure she walks down each trail
exactly twice.  It's also important that her two trips along each
trail be in opposite directions, so that she doesn't miss the same
thing twice.

A pair of fields might be connected by more than one trail.  Find
a path that Bessie can follow which will meet her requirements.
Such a path is guaranteed to exist.

从1开始访问,将每条边正向走一遍,反向也走一遍.</div><h2>Input</h2><div class=content>* Line 1: Two integers, N and M.

* Lines 2..M+1: Two integers denoting a pair of fields connected by a
        path.

</div><h2>Output</h2><div class=content>* Lines 1..2M+1: A list of fields she passes through, one per line,
        beginning and ending with the barn at field 1. If more than
        one solution is possible, output any solution.

</div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>4 5//四个点,五条边<br />
1 2<br />
1 4<br />
2 3<br />
2 4<br />
3 4<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>1<br />
2<br />
3<br />
4<br />
2<br />
1<br />
4<br />
3<br />
2<br />
4<br />
1<br />
<br />
OUTPUT DETAILS:<br />
<br />
Bessie starts at 1 (barn), goes to 2, then 3, etc...<br />
</span></div><h2>HINT</h2>
			<div class=content><p>请不要提交....</p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=Silver'>Silver</a></p></div><center>[<a href='submitpage.php?id=1678'>Submit</a>][<a href='problemstatus.php?id=1678'>Status</a>][<a href='bbs.php?id=1678'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
